@extends('adminDialog')

@section('content')
    <div class="pop_cont pop_table" style="height:550px;">

        <div class="search_type cc mb10">
            <form action="{{url('admin/stores/sub',['id'=>$model->id])}}" method="get" class="search_form">
                <label for="search_name">姓名：</label><input type="text" name="name" value="{{$name}}" id="search_name" class="input length_2 mr10"/>
                <button type="submit" class="btn mr10">提交查询</button>
                <a href="{{url('admin/stores/subupdate',['pid'=> $model->id])}}" title="新增子账号" class="btn J_dialog"><span class="add"></span>[新增子账号]</a>
            </form>
        </div>

        <div class="table_list">
            <div id="data_list">
                <table class="items">
                    <thead>
                    <tr>
                        <th>账号</th>
                        <th>姓名</th>
                        <th>状态</th>
                        <th>注册时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach ($list as $item)
                        <tr>
                            <td>{{$item->name}}</td>
                            <td>{{$item->real_name}}</td>
                            <td>@if ($item->status) <span class="green">启用</span> @else <span class="red">禁用</span> @endif</td>
                            <td>{{$item->created_at}}</td>
                            <td>
                                <a href="{{url('admin/stores/subupdate',['parent_id'=>$item->parent_id, 'id'=>$item->id])}}" title="{{$item->name}}的资料" class="mr10 J_dialog">[编辑]</a>
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>

            <div class="summary">
                共有 {{$list->total()}} 条数据
            </div>
            @if ($list->hasPages())
                <div class="pager">
                    <!--
                    <span style="float:left; margin-right:10px;">
                        转至<input type="text" id="goToPage" class="input" style="width:30px; text-align:center;">页
                        <span onclick="goto();" class="btn btn_submit">跳转</span>
                    </span>
                    -->
                    {!! $list->appends($appends)->render() !!}
                </div>
            @endif
        </div>
    </div>
@stop

@section('style')
    <style>
        .body_none {width:800px;}
    </style>
@stop